package org.zffc.filter;

import com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

/**
 * @Description:
 * @Note:
 * @Author: zhangfei
 * @Date: 2025/2/24 17:05
 **/
@Configuration
public class SentinelFilter {
    /**
     * 想要让gateway使用sentinel的功能，必须注册sentinel过滤器
     * @author zhangfei
     * @date 2025/2/25 09:53
     * @return
     */
    @Bean
    @Order(-1) // 确保 Sentinel 过滤器优先级较高
    public SentinelGatewayFilter sentinelGatewayFilter() {
        return new SentinelGatewayFilter();
    }
}
